﻿@{
    Layout = null;
    ViewBag.Controller = "orders";
}

@foreach (var item in ViewBag.View)
{
    <tr>
        <td><input type="checkbox" name="items" value="@item.id"/></td>
        <td>@item.fullname</td>
        <td>@item.phone</td>
        <td>@item.email</td>
        <td>@item.message</td>
        <td><span class="icon-status @if (item.status == 1) { Write("accept"); } else { Write("deny"); }" data-id="@item.id" ></span></td>
        <td>@item.created</td>
        <td><a href="#" class="order-product" data-id="@item.id" title="Chi tiết">Xem</a></td>
    </tr>
}

@if (ViewBag.View.Count == 0)
{
    <tr>
        <td colspan="8" class="empty-data">Không tìm thấy dữ liệu trả về</td>
    </tr>
}

<script type="text/javascript">
    $(function () {
        $(".pagination").pagination({
            items: @ViewBag.numPage,
            itemsOnPage: @ViewBag.pageSize,
            currentPage: @ViewBag.Page,
            cssStyle: 'light-theme',
            onPageClick: function (pageNumber, event) {
                //Load Content
                $('#content-loading').fadeIn(300);
                $.post('/admin/@ViewBag.Controller/LoadContentPurchased', { page: pageNumber, sort_by: "@ViewBag.Sort_By", sort_type: "@ViewBag.Sort_Type", keyword: "@ViewBag.Keyword" }, function (data) {
                    $numPage = pageNumber;
                    $('#_loadContentPurchased').html(data);
                    altRows('alternatecolor');
                    $('#content-loading').fadeOut(300);
                });
            },

        });
    });
</script>